﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GsmComm.GsmCommunication;

namespace Reporting
{
    public class ModemException : Exception
    {
        private int m_Code;
        private Modem m_Modem;

        //public const int RELOAD_DRIVER = 1;

        public ModemException(Modem modem, Exception innerException, int code)
            : base(String.Empty, innerException)
        {
            this.m_Code = code;
            this.m_Modem = modem;
        }

        private ModemException(Modem modem, string message)
            : base(message)
        {
            this.m_Code = 0;
            this.m_Modem = modem;
        }

        public ModemException(Modem modem, Exception innerException, string message, int code)
            : base(message, innerException)
        {
            this.m_Code = code;
            this.m_Modem = modem;
        }

        public ModemException(Modem modem, Exception innerException, string message)
            : base(message, innerException)
        {
            this.m_Code = -1;
            this.m_Modem = modem;
        }

        public int Code
        {
            get
            {
                return this.m_Code;
            }
        }

        public Modem Modem
        {
            get
            {
                return this.m_Modem;
            }
        }
    }
}
